<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><link rel="stylesheet" type="text/css" href="style.css" /><script type="text/javascript" src="highlight.js"></script></head><body><pre><span class="hs-keyword">module</span><span> </span><span class="hs-identifier">Data.Time.Calendar.JulianYearDay</span><span>
</span><span id="line-2"></span><span>    </span><span class="hs-special">(</span><span>
</span><span id="line-3"></span><span>    </span><span class="annot"><span class="hs-comment">-- * Year and day format</span></span><span>
</span><span id="line-4"></span><span>    </span><span class="hs-keyword">module</span><span> </span><span class="annot"><a href="Data.Time.Calendar.JulianYearDay.html"><span class="hs-identifier">Data.Time.Calendar.JulianYearDay</span></a></span><span>
</span><span id="line-5"></span><span>    </span><span class="hs-special">)</span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-6"></span><span>
</span><span id="line-7"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="Data.Time.Calendar.Days.html"><span class="hs-identifier">Data.Time.Calendar.Days</span></a></span><span>
</span><span id="line-8"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="Data.Time.Calendar.Private.html"><span class="hs-identifier">Data.Time.Calendar.Private</span></a></span><span>
</span><span id="line-9"></span><span>
</span><span id="line-10"></span><span class="hs-comment">-- | Convert to proleptic Julian year and day format. First element of result is year (proleptic Julian calendar),</span><span>
</span><span id="line-11"></span><span class="hs-comment">-- second is the day of the year, with 1 for Jan 1, and 365 (or 366 in leap years) for Dec 31.</span><span>
</span><span id="line-12"></span><span class="annot"><a href="Data.Time.Calendar.JulianYearDay.html#toJulianYearAndDay"><span class="hs-identifier hs-type">toJulianYearAndDay</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Data.Time.Calendar.Days.html#Day"><span class="hs-identifier hs-type">Day</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="hs-identifier hs-type">Integer</span></span><span class="hs-special">,</span><span class="annot"><span class="hs-identifier hs-type">Int</span></span><span class="hs-special">)</span><span>
</span><span id="line-13"></span><span id="toJulianYearAndDay"><span class="annot"><span class="annottext">toJulianYearAndDay :: Day -&gt; (Integer, Int)
</span><a href="Data.Time.Calendar.JulianYearDay.html#toJulianYearAndDay"><span class="hs-identifier hs-var hs-var">toJulianYearAndDay</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Data.Time.Calendar.Days.html#ModifiedJulianDay"><span class="hs-identifier hs-type">ModifiedJulianDay</span></a></span><span> </span><span id="local-6989586621679068484"><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621679068484"><span class="hs-identifier hs-var">mjd</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621679068483"><span class="hs-identifier hs-var">year</span></a></span><span class="hs-special">,</span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679068482"><span class="hs-identifier hs-var">yd</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-14"></span><span>    </span><span id="local-6989586621679068479"><span class="annot"><span class="annottext">a :: Integer
</span><a href="#local-6989586621679068479"><span class="hs-identifier hs-var hs-var">a</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621679068484"><span class="hs-identifier hs-var">mjd</span></a></span><span> </span><span class="annot"><span class="annottext">Integer -&gt; Integer -&gt; Integer
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#%2B"><span class="hs-operator hs-var">+</span></a></span><span> </span><span class="annot"><span class="annottext">Integer
</span><span class="hs-number">678577</span></span><span>
</span><span id="line-15"></span><span>    </span><span id="local-6989586621679068475"><span class="annot"><span class="annottext">quad :: Integer
</span><a href="#local-6989586621679068475"><span class="hs-identifier hs-var hs-var">quad</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Integer -&gt; Integer -&gt; Integer
forall a. Integral a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Real.html#div"><span class="hs-identifier hs-var">div</span></a></span><span> </span><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621679068479"><span class="hs-identifier hs-var">a</span></a></span><span> </span><span class="annot"><span class="annottext">Integer
</span><span class="hs-number">1461</span></span><span>
</span><span id="line-16"></span><span>    </span><span id="local-6989586621679068471"><span class="annot"><span class="annottext">d :: Integer
</span><a href="#local-6989586621679068471"><span class="hs-identifier hs-var hs-var">d</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Integer -&gt; Integer -&gt; Integer
forall a. Integral a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Real.html#mod"><span class="hs-identifier hs-var">mod</span></a></span><span> </span><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621679068479"><span class="hs-identifier hs-var">a</span></a></span><span> </span><span class="annot"><span class="annottext">Integer
</span><span class="hs-number">1461</span></span><span>
</span><span id="line-17"></span><span>    </span><span id="local-6989586621679068464"><span class="annot"><span class="annottext">y :: Integer
</span><a href="#local-6989586621679068464"><span class="hs-identifier hs-var hs-var">y</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Integer -&gt; Integer -&gt; Integer
forall a. Ord a =&gt; a -&gt; a -&gt; a
</span><span class="hs-identifier hs-var">min</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Integer -&gt; Integer -&gt; Integer
forall a. Integral a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Real.html#div"><span class="hs-identifier hs-var">div</span></a></span><span> </span><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621679068471"><span class="hs-identifier hs-var">d</span></a></span><span> </span><span class="annot"><span class="annottext">Integer
</span><span class="hs-number">365</span></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Integer
</span><span class="hs-number">3</span></span><span>
</span><span id="line-18"></span><span>    </span><span id="local-6989586621679068482"><span class="annot"><span class="annottext">yd :: Int
</span><a href="#local-6989586621679068482"><span class="hs-identifier hs-var hs-var">yd</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Integer -&gt; Int
forall a. Num a =&gt; Integer -&gt; a
</span><a href="../../base/src/GHC.Num.html#fromInteger"><span class="hs-identifier hs-var">fromInteger</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621679068471"><span class="hs-identifier hs-var">d</span></a></span><span> </span><span class="annot"><span class="annottext">Integer -&gt; Integer -&gt; Integer
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#-"><span class="hs-glyph hs-var">-</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621679068464"><span class="hs-identifier hs-var">y</span></a></span><span> </span><span class="annot"><span class="annottext">Integer -&gt; Integer -&gt; Integer
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#%2A"><span class="hs-operator hs-var">*</span></a></span><span> </span><span class="annot"><span class="annottext">Integer
</span><span class="hs-number">365</span></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Integer -&gt; Integer -&gt; Integer
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#%2B"><span class="hs-operator hs-var">+</span></a></span><span> </span><span class="annot"><span class="annottext">Integer
</span><span class="hs-number">1</span></span><span class="hs-special">)</span><span>
</span><span id="line-19"></span><span>    </span><span id="local-6989586621679068483"><span class="annot"><span class="annottext">year :: Integer
</span><a href="#local-6989586621679068483"><span class="hs-identifier hs-var hs-var">year</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621679068475"><span class="hs-identifier hs-var">quad</span></a></span><span> </span><span class="annot"><span class="annottext">Integer -&gt; Integer -&gt; Integer
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#%2A"><span class="hs-operator hs-var">*</span></a></span><span> </span><span class="annot"><span class="annottext">Integer
</span><span class="hs-number">4</span></span><span> </span><span class="annot"><span class="annottext">Integer -&gt; Integer -&gt; Integer
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#%2B"><span class="hs-operator hs-var">+</span></a></span><span> </span><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621679068464"><span class="hs-identifier hs-var">y</span></a></span><span> </span><span class="annot"><span class="annottext">Integer -&gt; Integer -&gt; Integer
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#%2B"><span class="hs-operator hs-var">+</span></a></span><span> </span><span class="annot"><span class="annottext">Integer
</span><span class="hs-number">1</span></span><span>
</span><span id="line-20"></span><span>
</span><span id="line-21"></span><span class="hs-comment">-- | Convert from proleptic Julian year and day format.</span><span>
</span><span id="line-22"></span><span class="hs-comment">-- Invalid day numbers will be clipped to the correct range (1 to 365 or 366).</span><span>
</span><span id="line-23"></span><span class="annot"><a href="Data.Time.Calendar.JulianYearDay.html#fromJulianYearAndDay"><span class="hs-identifier hs-type">fromJulianYearAndDay</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Integer</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Int</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Data.Time.Calendar.Days.html#Day"><span class="hs-identifier hs-type">Day</span></a></span><span>
</span><span id="line-24"></span><span id="fromJulianYearAndDay"><span class="annot"><span class="annottext">fromJulianYearAndDay :: Integer -&gt; Int -&gt; Day
</span><a href="Data.Time.Calendar.JulianYearDay.html#fromJulianYearAndDay"><span class="hs-identifier hs-var hs-var">fromJulianYearAndDay</span></a></span></span><span> </span><span id="local-6989586621679068449"><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621679068449"><span class="hs-identifier hs-var">year</span></a></span></span><span> </span><span id="local-6989586621679068448"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679068448"><span class="hs-identifier hs-var">day</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Integer -&gt; Day
</span><a href="Data.Time.Calendar.Days.html#ModifiedJulianDay"><span class="hs-identifier hs-var">ModifiedJulianDay</span></a></span><span> </span><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621679068447"><span class="hs-identifier hs-var">mjd</span></a></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-25"></span><span>    </span><span id="local-6989586621679068444"><span class="annot"><span class="annottext">y :: Integer
</span><a href="#local-6989586621679068444"><span class="hs-identifier hs-var hs-var">y</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621679068449"><span class="hs-identifier hs-var">year</span></a></span><span> </span><span class="annot"><span class="annottext">Integer -&gt; Integer -&gt; Integer
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#-"><span class="hs-glyph hs-var">-</span></a></span><span> </span><span class="annot"><span class="annottext">Integer
</span><span class="hs-number">1</span></span><span>
</span><span id="line-26"></span><span>    </span><span id="local-6989586621679068447"><span class="annot"><span class="annottext">mjd :: Integer
</span><a href="#local-6989586621679068447"><span class="hs-identifier hs-var hs-var">mjd</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int -&gt; Integer
forall a b. (Integral a, Num b) =&gt; a -&gt; b
</span><a href="../../base/src/GHC.Real.html#fromIntegral"><span class="hs-identifier hs-var">fromIntegral</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Int -&gt; Int
forall t. Ord t =&gt; t -&gt; t -&gt; t -&gt; t
</span><a href="Data.Time.Calendar.Private.html#clip"><span class="hs-identifier hs-var">clip</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">1</span></span><span> </span><span class="hs-special">(</span><span class="hs-keyword">if</span><span> </span><span class="annot"><span class="annottext">Integer -&gt; Bool
</span><a href="Data.Time.Calendar.JulianYearDay.html#isJulianLeapYear"><span class="hs-identifier hs-var">isJulianLeapYear</span></a></span><span> </span><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621679068449"><span class="hs-identifier hs-var">year</span></a></span><span> </span><span class="hs-keyword">then</span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">366</span></span><span> </span><span class="hs-keyword">else</span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">365</span></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679068448"><span class="hs-identifier hs-var">day</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Integer -&gt; Integer -&gt; Integer
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#%2B"><span class="hs-operator hs-var">+</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Integer
</span><span class="hs-number">365</span></span><span> </span><span class="annot"><span class="annottext">Integer -&gt; Integer -&gt; Integer
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#%2A"><span class="hs-operator hs-var">*</span></a></span><span> </span><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621679068444"><span class="hs-identifier hs-var">y</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Integer -&gt; Integer -&gt; Integer
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#%2B"><span class="hs-operator hs-var">+</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Integer -&gt; Integer -&gt; Integer
forall a. Integral a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Real.html#div"><span class="hs-identifier hs-var">div</span></a></span><span> </span><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621679068444"><span class="hs-identifier hs-var">y</span></a></span><span> </span><span class="annot"><span class="annottext">Integer
</span><span class="hs-number">4</span></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Integer -&gt; Integer -&gt; Integer
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#-"><span class="hs-glyph hs-var">-</span></a></span><span> </span><span class="annot"><span class="annottext">Integer
</span><span class="hs-number">678578</span></span><span>
</span><span id="line-27"></span><span>
</span><span id="line-28"></span><span class="hs-comment">-- | Convert from proleptic Julian year and day format.</span><span>
</span><span id="line-29"></span><span class="hs-comment">-- Invalid day numbers will return Nothing</span><span>
</span><span id="line-30"></span><span class="annot"><a href="Data.Time.Calendar.JulianYearDay.html#fromJulianYearAndDayValid"><span class="hs-identifier hs-type">fromJulianYearAndDayValid</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Integer</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Int</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="annot"><a href="Data.Time.Calendar.Days.html#Day"><span class="hs-identifier hs-type">Day</span></a></span><span>
</span><span id="line-31"></span><span id="fromJulianYearAndDayValid"><span class="annot"><span class="annottext">fromJulianYearAndDayValid :: Integer -&gt; Int -&gt; Maybe Day
</span><a href="Data.Time.Calendar.JulianYearDay.html#fromJulianYearAndDayValid"><span class="hs-identifier hs-var hs-var">fromJulianYearAndDayValid</span></a></span></span><span> </span><span id="local-6989586621679068425"><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621679068425"><span class="hs-identifier hs-var">year</span></a></span></span><span> </span><span id="local-6989586621679068424"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679068424"><span class="hs-identifier hs-var">day</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-32"></span><span>    </span><span id="local-6989586621679068423"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679068423"><span class="hs-identifier hs-var">day'</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Int -&gt; Maybe Int
forall t. Ord t =&gt; t -&gt; t -&gt; t -&gt; Maybe t
</span><a href="Data.Time.Calendar.Private.html#clipValid"><span class="hs-identifier hs-var">clipValid</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">1</span></span><span> </span><span class="hs-special">(</span><span class="hs-keyword">if</span><span> </span><span class="annot"><span class="annottext">Integer -&gt; Bool
</span><a href="Data.Time.Calendar.JulianYearDay.html#isJulianLeapYear"><span class="hs-identifier hs-var">isJulianLeapYear</span></a></span><span> </span><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621679068425"><span class="hs-identifier hs-var">year</span></a></span><span> </span><span class="hs-keyword">then</span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">366</span></span><span> </span><span class="hs-keyword">else</span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">365</span></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679068424"><span class="hs-identifier hs-var">day</span></a></span><span>
</span><span id="line-33"></span><span>    </span><span class="hs-keyword">let</span><span>
</span><span id="line-34"></span><span>        </span><span id="local-6989586621679068419"><span class="annot"><span class="annottext">y :: Integer
</span><a href="#local-6989586621679068419"><span class="hs-identifier hs-var hs-var">y</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621679068425"><span class="hs-identifier hs-var">year</span></a></span><span> </span><span class="annot"><span class="annottext">Integer -&gt; Integer -&gt; Integer
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#-"><span class="hs-glyph hs-var">-</span></a></span><span> </span><span class="annot"><span class="annottext">Integer
</span><span class="hs-number">1</span></span><span>
</span><span id="line-35"></span><span>        </span><span id="local-6989586621679068408"><span class="annot"><span class="annottext">mjd :: Integer
</span><a href="#local-6989586621679068408"><span class="hs-identifier hs-var hs-var">mjd</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int -&gt; Integer
forall a b. (Integral a, Num b) =&gt; a -&gt; b
</span><a href="../../base/src/GHC.Real.html#fromIntegral"><span class="hs-identifier hs-var">fromIntegral</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679068423"><span class="hs-identifier hs-var">day'</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Integer -&gt; Integer -&gt; Integer
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#%2B"><span class="hs-operator hs-var">+</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Integer
</span><span class="hs-number">365</span></span><span> </span><span class="annot"><span class="annottext">Integer -&gt; Integer -&gt; Integer
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#%2A"><span class="hs-operator hs-var">*</span></a></span><span> </span><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621679068419"><span class="hs-identifier hs-var">y</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Integer -&gt; Integer -&gt; Integer
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#%2B"><span class="hs-operator hs-var">+</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Integer -&gt; Integer -&gt; Integer
forall a. Integral a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Real.html#div"><span class="hs-identifier hs-var">div</span></a></span><span> </span><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621679068419"><span class="hs-identifier hs-var">y</span></a></span><span> </span><span class="annot"><span class="annottext">Integer
</span><span class="hs-number">4</span></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Integer -&gt; Integer -&gt; Integer
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#-"><span class="hs-glyph hs-var">-</span></a></span><span> </span><span class="annot"><span class="annottext">Integer
</span><span class="hs-number">678578</span></span><span>
</span><span id="line-36"></span><span>    </span><span class="annot"><span class="annottext">Day -&gt; Maybe Day
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Integer -&gt; Day
</span><a href="Data.Time.Calendar.Days.html#ModifiedJulianDay"><span class="hs-identifier hs-var">ModifiedJulianDay</span></a></span><span> </span><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621679068408"><span class="hs-identifier hs-var">mjd</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-37"></span><span>
</span><span id="line-38"></span><span class="hs-comment">-- | Show in proleptic Julian year and day format (yyyy-ddd)</span><span>
</span><span id="line-39"></span><span class="annot"><a href="Data.Time.Calendar.JulianYearDay.html#showJulianYearAndDay"><span class="hs-identifier hs-type">showJulianYearAndDay</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Data.Time.Calendar.Days.html#Day"><span class="hs-identifier hs-type">Day</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span>
</span><span id="line-40"></span><span id="showJulianYearAndDay"><span class="annot"><span class="annottext">showJulianYearAndDay :: Day -&gt; String
</span><a href="Data.Time.Calendar.JulianYearDay.html#showJulianYearAndDay"><span class="hs-identifier hs-var hs-var">showJulianYearAndDay</span></a></span></span><span> </span><span id="local-6989586621679068406"><span class="annot"><span class="annottext">Day
</span><a href="#local-6989586621679068406"><span class="hs-identifier hs-var">date</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Integer -&gt; String
forall t. ShowPadded t =&gt; t -&gt; String
</span><a href="Data.Time.Calendar.Private.html#show4"><span class="hs-identifier hs-var">show4</span></a></span><span> </span><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621679068404"><span class="hs-identifier hs-var">y</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">String -&gt; String -&gt; String
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;-&quot;</span></span><span> </span><span class="annot"><span class="annottext">String -&gt; String -&gt; String
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int -&gt; String
forall t. ShowPadded t =&gt; t -&gt; String
</span><a href="Data.Time.Calendar.Private.html#show3"><span class="hs-identifier hs-var">show3</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679068402"><span class="hs-identifier hs-var">d</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-41"></span><span>    </span><span class="hs-special">(</span><span id="local-6989586621679068404"><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621679068404"><span class="hs-identifier hs-var">y</span></a></span></span><span class="hs-special">,</span><span id="local-6989586621679068402"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679068402"><span class="hs-identifier hs-var">d</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Day -&gt; (Integer, Int)
</span><a href="Data.Time.Calendar.JulianYearDay.html#toJulianYearAndDay"><span class="hs-identifier hs-var">toJulianYearAndDay</span></a></span><span> </span><span class="annot"><span class="annottext">Day
</span><a href="#local-6989586621679068406"><span class="hs-identifier hs-var">date</span></a></span><span>
</span><span id="line-42"></span><span>
</span><span id="line-43"></span><span class="hs-comment">-- | Is this year a leap year according to the proleptic Julian calendar?</span><span>
</span><span id="line-44"></span><span class="annot"><a href="Data.Time.Calendar.JulianYearDay.html#isJulianLeapYear"><span class="hs-identifier hs-type">isJulianLeapYear</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Integer</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Bool</span></span><span>
</span><span id="line-45"></span><span id="isJulianLeapYear"><span class="annot"><span class="annottext">isJulianLeapYear :: Integer -&gt; Bool
</span><a href="Data.Time.Calendar.JulianYearDay.html#isJulianLeapYear"><span class="hs-identifier hs-var hs-var">isJulianLeapYear</span></a></span></span><span> </span><span id="local-6989586621679068401"><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621679068401"><span class="hs-identifier hs-var">year</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Integer -&gt; Integer -&gt; Integer
forall a. Integral a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Real.html#mod"><span class="hs-identifier hs-var">mod</span></a></span><span> </span><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621679068401"><span class="hs-identifier hs-var">year</span></a></span><span> </span><span class="annot"><span class="annottext">Integer
</span><span class="hs-number">4</span></span><span> </span><span class="annot"><span class="annottext">Integer -&gt; Integer -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">==</span></span><span> </span><span class="annot"><span class="annottext">Integer
</span><span class="hs-number">0</span></span><span class="hs-special">)</span><span>
</span><span id="line-46"></span></pre></body></html>